﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Employees/Employee.master" AutoEventWireup="true"
    CodeBehind="ManageEmployees.aspx.cs" Inherits="_00365.Employees.ManageEmployees" %>

<asp:Content ID="ctt1" ContentPlaceHolderID="cphAreaTitle" runat="server">
    Gerenciar Funcionários
</asp:Content>
<asp:Content ID="ctt2" ContentPlaceHolderID="cphContent" runat="server">
    <div class="alignleft clear">
        <div class="alignleft">
            <div class="content alignleft">
                <p>
                    <asp:Label ID="lblSubsidiary" runat="server" Text="Unidade" AssociatedControlID="ddlSubsidiary"></asp:Label>
                    <asp:DropDownList ID="ddlSubsidiary" runat="server" DataTextField="CompanyName" DataValueField="Id">
                    </asp:DropDownList>
                </p>
                <p>
                    <asp:Label ID="lblGender" runat="server" Text="Sexo" AssociatedControlID="rdlGender"></asp:Label>
                    <asp:RadioButtonList runat="server" ID="rdlGender">
                        <asp:ListItem Text="Todos" Value="All" Selected="True" />
                        <asp:ListItem Text="Masculino" Value="M" />
                        <asp:ListItem Text="Feminino" Value="F" />
                    </asp:RadioButtonList>
                </p>
                <p>
                    <asp:Label ID="lblPosition" runat="server" Text="Cargo" AssociatedControlID="txtPosition"></asp:Label>
                    <asp:TextBox ID="txtPosition" runat="server"></asp:TextBox>
                </p>
                <p>
                    <asp:Label ID="lblDepartment" runat="server" Text="Setor" AssociatedControlID="txtDepartment"></asp:Label>
                    <asp:TextBox ID="txtDepartment" runat="server"></asp:TextBox>
                </p>
                <p>
                    <asp:Label ID="lblAge" runat="server" Text="Idade" AssociatedControlID="txtAge"></asp:Label>
                    <asp:TextBox ID="txtAge" runat="server"></asp:TextBox>
                </p>
                <p>
                    <asp:Label ID="lblDependent" runat="server" Text="Dependentes" AssociatedControlID="rdlDependent"></asp:Label>
                    <asp:RadioButtonList runat="server" ID="rdlDependent">
                        <asp:ListItem Text="Todos" Value="All" Selected="True" />
                        <asp:ListItem Text="Sim" Value="True" />
                        <asp:ListItem Text="Não" Value="False" />
                    </asp:RadioButtonList>
                </p>
                <p>
                    <asp:Label ID="lblMarriageStatus" runat="server" Text="Estado Civil" AssociatedControlID="ddlMarriageStatus"></asp:Label>
                    <asp:DropDownList runat="server" ID="ddlMarriageStatus">
                        <asp:ListItem Text="Todos" Value="All" Selected="True" />
                        <asp:ListItem Text="Solteiro" Value="S" />
                        <asp:ListItem Text="Casado" Value="C" />
                        <asp:ListItem Text="Viúvo" Value="V" />
                        <asp:ListItem Text="Separado" Value="D" />
                    </asp:DropDownList>
                </p>
                <p>
                    <asp:Label ID="Label1" runat="server" Text="Escolaridade" AssociatedControlID="ddlSchoolDegree"></asp:Label>
                    <asp:DropDownList runat="server" ID="ddlSchoolDegree">
                        <asp:ListItem Text="Todos" Value="All" Selected="True" />
                        <asp:ListItem Text="Ensino Fundamental" Value="F" />
                        <asp:ListItem Text="Ensino Médio" Value="M" />
                        <asp:ListItem Text="Técnico" Value="T" />
                        <asp:ListItem Text="Superior" Value="S" />
                    </asp:DropDownList>
                </p>
                <p>
                    <asp:Label ID="lblPeriod" runat="server" Text="Turno" AssociatedControlID="txtPeriod"></asp:Label>
                    <asp:TextBox ID="txtPeriod" runat="server"></asp:TextBox>
                </p>
                <p>
                    <asp:Label ID="lblWorkingPeriod" runat="server" Text="Tempo de Empresa" AssociatedControlID="txtWorkingPeriod"></asp:Label>
                    <asp:TextBox ID="txtWorkingPeriod" runat="server"></asp:TextBox><asp:Label Text=" anos"
                        runat="server" />
                </p>
                <p>
                    <asp:Label ID="lblOccupation" runat="server" Text="Profissão" AssociatedControlID="txtOccupation"></asp:Label>
                    <asp:TextBox ID="txtOccupation" runat="server"></asp:TextBox>
                </p>
                <p>
                    <asp:Label ID="Label2" runat="server" Text="Faixa Salarial" AssociatedControlID="txtRevenueFrom"></asp:Label>
                    <asp:Label Text="De:" runat="server" /><asp:TextBox ID="txtRevenueFrom" runat="server"></asp:TextBox>
                    <asp:Label Text="Até:" runat="server" /><asp:TextBox ID="txtRevenueTo" runat="server"></asp:TextBox>
                </p>
            </div>
            <div class="footer-container clear alignright">
                <asp:Button ID="btnSearch" runat="server" Text="Busca" OnClick="btnSearch_Click" />
            </div>
            <div class="footer-container clear" style="color: #f00; text-align: center;">
                <asp:Label ID="lblParameterValidation" runat="server" Text=""></asp:Label>
            </div>
        </div>
        <div class="clear20">
        </div>
    </div>
    <asp:GridView ID="grdEmployee" runat="server" AutoGenerateColumns="False" Width="500px"
        OnRowCommand="grdEmployee_RowCommand" OnPageIndexChanged="grdEmployee_PageIndexChanged"
        OnPageIndexChanging="grdEmployee_PageIndexChanging" ViewStateMode="Enabled" AllowPaging="true"
        PageSize="10">
        <EmptyDataTemplate>
            <div class="box">
                Sem dados para exibição. Configure uma pesquisa e clique no botão "Pesquisar"
                <div class="clear">
                </div>
            </div>
        </EmptyDataTemplate>
        <Columns>
            <asp:BoundField DataField="FullName" HeaderText="Usuário" ReadOnly="True">
                <ItemStyle Width="140px" HorizontalAlign="Left" />
            </asp:BoundField>
            <asp:BoundField DataField="Company.CompanyName" HeaderText="Empresa" ReadOnly="True">
                <ItemStyle Width="140px" HorizontalAlign="Left" />
            </asp:BoundField>
            <asp:BoundField DataField="BirthDate" HeaderText="Data Nasc." ReadOnly="True" DataFormatString="{0:dd/MM/yyyy}">
                <ItemStyle Width="100" HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Sexo">
                <ItemTemplate>
                    <%# ( DataBinder.Eval(Container.DataItem, "Gender").Equals("M") ? "Masculino" : "Feminino" ) %>
                </ItemTemplate>
                <ItemStyle Width="50px" HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Ações">
                <ItemTemplate>
                    <asp:LinkButton ID="btnEditUser" runat="server" CommandName="EditEmployee" CommandArgument='<%# DataBinder.Eval (Container.DataItem, "Id") %>'>
                        <asp:Image ID="Image2" ImageUrl="~/images/edit.png" runat="server" AlternateText="Alterar"
                            ToolTip="Alterar dados do usuário" />
                    </asp:LinkButton>&nbsp;
                    <asp:LinkButton ID="btnRemoveUser" runat="server" CommandName="DeleteEmployee" CommandArgument='<%# DataBinder.Eval (Container.DataItem, "Id") %>'>
                        <asp:Image ID="Image3" ImageUrl="~/images/delete.png" runat="server" AlternateText="Excluir"
                            ToolTip="Excluir usuário" />
                    </asp:LinkButton>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="70px" />
            </asp:TemplateField>
        </Columns>
        <HeaderStyle CssClass="head" />
        <PagerStyle CssClass="head" HorizontalAlign="Center" VerticalAlign="Middle" />
    </asp:GridView>
    <%--popup Delete message--%>
    <asp:Panel ID="pnlDeleteMsg" runat="server" CssClass="popUpDialog">
        <div id="divMsgDeleteTitle" runat="server" class="popUpDialogTitle head box" style="cursor: move;">
            <asp:Label ID="Label3" Text="Excluir Funcionário" runat="server" Style="cursor: move;" />
            <div class="alignright">
                <asp:ImageButton ID="btnCloseDeleteMsg" runat="server" ImageUrl="~/images/popup_close.png"
                    AlternateText="Fechar" OnClick="btnClosePopup_Click" ToolTip="Fechar" /></div>
            <div class="clear">
            </div>
        </div>
        <div class="content">
            <p style="text-align: center;">
                <asp:Label ID="lblDeleteMsg" runat="server" Text="Deseja realmente remover o funcionário &quot;{0}&quot;?"></asp:Label></p>
        </div>
        <div class="content" style="text-align: center; margin-top: 25px;">
            <asp:Button ID="btnDeleteMsgYes" runat="server" Text="Sim" OnClick="btnDeleteMsgYes_Click" />
            &nbsp;
            <asp:Button ID="btnDeleteMsgNo" runat="server" Text="Não" OnClick="btnDeleteMsgNo_Click" />
        </div>
        <div class="clear">
        </div>
    </asp:Panel>
    <asp:HiddenField ID="hidSelected" runat="server" Value="" />
    <a href="#" id="lnkShowPopupDeleteMsg" runat="server" style="display: none;">x</a>
    <ajaxToolkit:ModalPopupExtender ID="popDeleteMsg" runat="server" BackgroundCssClass="modalBackground"
        CancelControlID="lnkShowPopupDeleteMsg" OkControlID="lnkShowPopupDeleteMsg" PopupControlID="pnlDeleteMsg"
        PopupDragHandleControlID="divMsgDeleteTitle" ViewStateMode="Disabled" TargetControlID="lnkShowPopupDeleteMsg">
    </ajaxToolkit:ModalPopupExtender>
</asp:Content>
